]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageList: Only close messages via delete key if they can be closed
authorPhilProg <philroh2008@gmail.com>
Fri, 3 Jun 2022 04:53:11 +0000 (04:53 +0000)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 4 Jun 2022 13:23:45 +0000 (15:23 +0200)
If the delete key is pressed while a message/MPRIS indicator is focused
GNOME now asks whether the message/MPRIS indicator is closable.
If yes it will be closed but if not it won't be closed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5536

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2323>

js/ui/messageList.js

index f4e43f7aed0215b73cb272dbda9ee79b697e5e33..29e76752b8c15d53366249aa1c72275cce0eeb98 100644 (file)
@@ -535,8 +535,10 @@ var Message = GObject.registerClass({
 
         if (keysym == Clutter.KEY_Delete ||
             keysym == Clutter.KEY_KP_Delete) {
-            this.close();
-            return Clutter.EVENT_STOP;
+            if (this.canClose()) {
+                this.close();
+                return Clutter.EVENT_STOP;
+            }
         }
         return super.vfunc_key_press_event(keyEvent);
     }